package com.lemon.cloud.admin.feign;

import com.lemon.cloud.admin.entity.OAuthClientDetails;
import com.lemon.cloud.comm.model.ResultMsg;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

import static com.lemon.cloud.comm.constants.OAuth2Constant.*;

@FeignClient(value = "admin-service", contextId = "clientDetailsFeign")
public interface ClientDetailsFeign {


    /**
     * 通过clientId 查询客户端信息
     * @param clientId 用户名
     * @return ResultMsg
     */
    @GetMapping(value = "/client/getClientDetailsById/{clientId}", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<OAuthClientDetails> getClientDetailsById(@PathVariable("clientId") String clientId);

    /**
     * 查询全部客户端
     * @return ResultMsg
     */
    @GetMapping(value = "/client/list", headers = {FROM + EQUAL + FROM_IN})
    ResultMsg<List<OAuthClientDetails>> listClientDetails();

}
